﻿@model IEnumerable<OAWeb.Models.Department>

@{
    ViewBag.Title = "部门";
}

<h2>部门信息</h2>

<p>
    @Html.ActionLink("新建", "Create")
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.DepartmentName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.CreateYear)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Leader)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.DepartmentName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CreateYear)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Leader)
        </td>
        <td>
            @Html.ActionLink("更改", "Edit", new { id=item.DepartmentID }) |
            @Html.ActionLink("详细信息", "Details", new { id=item.DepartmentID }) |
           @Html.ActionLink("删除", "Delete", new { id = item.DepartmentID }, new { onclick = "confirm('你确认删除吗？')" })
        </td>
    </tr>
}

</table>
